import request from '@/utils/request'

export default {



    //项目列表
    getProjectList(searchModel) {
        return request({
            url: '/project',
            method: 'get',
            params: {

            }
        });
    },

    //新增/修改项目
    saveProject(form) {
        if (form.id) {
            var url = '/project/' + form.id;
        } else {
            var url = '/project';
        }
        return request({
            url: url,
            method: 'post',
            params: {
                //合同id
                contract_id: form.contract_id,
                //标题
                title: form.title,
                //地址
                address: form.address,
                //建设规模
                size: form.size,
                //联系电话
                phone:form.phone,
                //耕地占用费(是否缴纳)
                gdzyf: form.gdzyf,
                //土地使用税（是否缴纳）
                tdsys: form.tdsys,
                //城市维护建设税（适用税率）
                cswhjss: form.cswhjss,
                //土地增值税项目编号
                tdzzs: form.tdzzs,
                //时间
                time: form.time,
                //联系人
                tableData:form.tableData,
            }
        });
    },

    //项目详情
    getProjectInfo(id) {
        return request({
            url: '/project/' + id,
            method: 'get',
        });
    },

    //获取项目员工列表
    getProjectUserInfo(id) {
        return request({
            url: '/project/user/' + id,
            method: 'get',
        });
    },

    //获取个人所有项目信息
    getProjectAll() {
        return request({
            url: '/projectall/all',
            method: 'post',

        });
    },

    //模糊搜索项目名称
    projectKeyword(keyword) {
        return request({
            url: '/project_keyword/' + keyword,
            method: 'get',

        });
    },
    


    //证件接口

    //添加证件信息
    saveCredentials(form) {
        if (form.id) {
            var url = '/credentials/' + form.id;
        } else {
            var url = '/credentials';
        }
        return request({
            url: url,
            method: 'post',
            params: {
                //项目id
                project_id: form.project_id,
                //类型
                type: form.typeid,
                //内容
                a: form.a,
                b: form.b,
                c: form.c,
                d: form.d,
                e: form.e,
                f: form.f,
                g: form.g,
                h: form.h,
                i: form.i,
                j: form.j,
                k: form.k,
                l: form.l,
            }
        });
    },

    //根据项目id和类型id获取证件列表信息
    getProjectCredentials(project_id, type) {
        return request({
            url: '/project/' + project_id + '/' + type,
            method: 'get',
        });
    },

    //根据id获取单个证件信息
    getCredentialById(id) {
        return request({
            url: '/credentials/' + id,
            method: 'get',
        });
    },

    //根据id删除证件信息
    delCredentialById(id) {
        return request({
            url: '/credentials/' + id,
            method: 'post',
        });
    },








    // getClientList(searchModel) {
    //     return request({
    //         url: '/client',
    //         method: 'get',
    //         params:{
    //             page:searchModel.pageNo,
    //             paginate:searchModel.pageSize,
    //             pageSize:searchModel.pageSize,
    //             username:searchModel.username,
    //             uid:searchModel.uid,
    //         }
    //     });
    // },


}